package org.toy.wechat.gym.controller;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.toy.wechat.core.common.base.BaseResult;
import org.toy.wechat.core.common.base.BaseResultGenerator;
import org.toy.wechat.gym.request.GymLoginRequest;
import org.toy.wechat.gym.service.IGymLoginService;

import javax.validation.Valid;

/**
 * @Description
 * @Author devin
 * @Date: 2020/2/22 0022 22:10
 */
@RestController
@Api(value = "/GymLoginController", tags = "登录接口")
@RequestMapping("/gym/user")
public class GymLoginController {

    @Autowired
    private IGymLoginService gymLoginService;


    @PostMapping("/login")
    public BaseResult login(@RequestBody @Valid GymLoginRequest gymLoginRequest) {
        return BaseResultGenerator.success(gymLoginService.login(gymLoginRequest));
    }

}
